UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mikdDEvfedqJqh6X2q5MzYtoISoy5RQoIeg27Qn48+o=' 
WHERE 
  key_id = '90ddbe368374dc5b2bb4b5ebf82926f11e7b5678385f0763665a578964dcd7ce' 
  AND (
    token = 'mikdDEvfedqJqh6X2q5MzYtoISoy5RQoIeg27Qn48+o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041