UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7RQTnH5wtUIF/CHakepqPtlNeJrqAqzNU/gQrp340n8=' 
WHERE 
  key_id = 'b1944a0b8ee44275c6784a809ff153510179ace75be48384c218e973606275ea' 
  AND (
    token = '7RQTnH5wtUIF/CHakepqPtlNeJrqAqzNU/gQrp340n8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035