UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cjN/wu6JXOId0FpC6RAeQDDlHNX48Qx3+PTlYGEqgHE=' 
WHERE 
  key_id = 'ac922c3bc690b845f0ebb3edfe522ada34402c3c281dd35eebfcef764383c0bf' 
  AND (
    token = 'cjN/wu6JXOId0FpC6RAeQDDlHNX48Qx3+PTlYGEqgHE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024