UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DGiEXt+ECZEFGWwjJuxY3U8K2Dx6RbRY/5gJHNjHq+Q=' 
WHERE 
  key_id = 'b29af74ef0568c0c26ee68af3022441e3b77ef2c4fa9bde2da91d7ae38b1c587' 
  AND (
    token = 'DGiEXt+ECZEFGWwjJuxY3U8K2Dx6RbRY/5gJHNjHq+Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022