UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MBMsWvJdEFx9FgNnvNkJrnO5kGMO2phCXg/+roQLHjk=' 
WHERE 
  key_id = '71fb4ff206ef01ca639b57a028248fb84fe97c4f32662fb47c2c12f8cdc7f6fd' 
  AND (
    token = 'MBMsWvJdEFx9FgNnvNkJrnO5kGMO2phCXg/+roQLHjk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050