UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rK6LrsxFo/Jz1RsxaGXRQoQlJ6BO5q/3sgLA3AnSDqM=' 
WHERE 
  key_id = 'ae1009ef001ce47d1c6955d8e8197883469a28ae7e6317a4219feb8286fe36c3' 
  AND (
    token = 'rK6LrsxFo/Jz1RsxaGXRQoQlJ6BO5q/3sgLA3AnSDqM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022