UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pLLsLDcJF29M7HlQZiavTx3T+5PLU4W/SBAL3BzjzF4=' 
WHERE 
  key_id = 'b678b0ebd949fb71c759dda3e51aed0b3d0594420d44a838280e1485d2cdd966' 
  AND (
    token = 'pLLsLDcJF29M7HlQZiavTx3T+5PLU4W/SBAL3BzjzF4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034