UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mth48hp612K1ZsMQULpWtxEwkacli/HonzFAWqQGg2w=' 
WHERE 
  key_id = '42bc872b7faac6c7328bc91436c78ced189e74221053f10d1c7575e8f0a19bfb' 
  AND (
    token = 'mth48hp612K1ZsMQULpWtxEwkacli/HonzFAWqQGg2w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037