UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ESXY8yy+WTxRe0BFPGlM8eN8J/Ck3+mGutR/zEXuMnI=' 
WHERE 
  key_id = 'eed231c9aad094ee600b46164a8871032a2ee33d88f6e12846db3dbc5a028e95' 
  AND (
    token = 'ESXY8yy+WTxRe0BFPGlM8eN8J/Ck3+mGutR/zEXuMnI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031