UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TP3MJlDD/7im/HTHOY0lHK/WtHKboyEK3iAs+8UaQnE=' 
WHERE 
  key_id = '5c117b50cad6c44b08076642df28eba1ae42ad4b85dc25fa09c2d69977bf459a' 
  AND (
    token = 'TP3MJlDD/7im/HTHOY0lHK/WtHKboyEK3iAs+8UaQnE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041