UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9spcHRi8AGgoDX+PKEKN5F1FxiF6d/FpjTPMAPQgWak=' 
WHERE 
  key_id = '2eb76f5af441ab7ddcb2f91a07010f6d699304adc00835447ba05df85961aff0' 
  AND (
    token = '9spcHRi8AGgoDX+PKEKN5F1FxiF6d/FpjTPMAPQgWak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020