UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hspxt4MrPnhSufbwPb23oINldXflg4ECAw37f4FEC7E=' 
WHERE 
  key_id = 'a728e7c61c3291b3713f29632e71b90725edea22e30877aedb85435bb7a0d5af' 
  AND (
    token = 'hspxt4MrPnhSufbwPb23oINldXflg4ECAw37f4FEC7E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027