UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KGbaYdb+KmnVKdgXhtXw4jDvaaAbm9EqQWDbxm2O57s=' 
WHERE 
  key_id = 'bcfb61cfc6b901ae707c244304cd5959ca72e59a17de77ed0c484ea5587575a6' 
  AND (
    token = 'KGbaYdb+KmnVKdgXhtXw4jDvaaAbm9EqQWDbxm2O57s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032