UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Avx7hYrE25DTfd3o8zpiyyB2v3Ekx0/dzZWoRkzpZXc=' 
WHERE 
  key_id = '93be7be937eb9d84bb82ec89628cf90598fe4657e76b3849c2122c3a74df3d02' 
  AND (
    token = 'Avx7hYrE25DTfd3o8zpiyyB2v3Ekx0/dzZWoRkzpZXc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051