UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4c/LjpdDzgIJuXw1GjOmUrpmuSeH7NVqGXgOgcEYd4A=' 
WHERE 
  key_id = 'bd3abc9cb800fb6ce80017c19df129cfac92a1f5d50f8cea8966c190bce49cb1' 
  AND (
    token = '4c/LjpdDzgIJuXw1GjOmUrpmuSeH7NVqGXgOgcEYd4A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038