UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HgyYz5/bmSgYBxj8tFL1UrtIPPw6Mj7bckZ7bKkWUZ4=' 
WHERE 
  key_id = '11d5cc7304360d3b05b725981457450b5ff42b8b8fefef577b74d8adf1f38941' 
  AND (
    token = 'HgyYz5/bmSgYBxj8tFL1UrtIPPw6Mj7bckZ7bKkWUZ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017