UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uTr+gY/gK25Gar3ee0vldbvMUDypKov2/ks6FIypN0M=' 
WHERE 
  key_id = '4f754288b0ef2b15b7546794a77b4875b33934715579b5bd6ea8f84c38606532' 
  AND (
    token = 'uTr+gY/gK25Gar3ee0vldbvMUDypKov2/ks6FIypN0M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030