UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rH+63aQAA5gjpV0Qi/yj/br0rbxSKiTvomnHnBlp8eI=' 
WHERE 
  key_id = '25f08788393fb26ee64893fac78f2cc3c0a8c65cb4a246226027dd55cf16ba68' 
  AND (
    token = 'rH+63aQAA5gjpV0Qi/yj/br0rbxSKiTvomnHnBlp8eI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030