UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LE8NIY8TtckAI/M95s1eujhNVnG5/2qrSP3BUuZTgxI=' 
WHERE 
  key_id = 'ed38b23490a2f26ce874c5e1df0ba0c6eebeb32bee13151405da161e3ab10884' 
  AND (
    token = 'LE8NIY8TtckAI/M95s1eujhNVnG5/2qrSP3BUuZTgxI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046