UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JrvDq+FDFhWFIiyOTJquSpnQ14/501YnAxFjtelDRd0=' 
WHERE 
  key_id = '9c7b3c103acb81b3859b16b7c95f18f1ba46894641df25f08fb644d71cb6964d' 
  AND (
    token = 'JrvDq+FDFhWFIiyOTJquSpnQ14/501YnAxFjtelDRd0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041