UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zPMsqM9T6RBeIvWOrhPrj1DR6YxQW9TZvqGi8ZD/KDo=' 
WHERE 
  key_id = 'acd2015ab6fbd0d3551c80e2f1b360b30c14eed746145dd31f409a16385e1e3e' 
  AND (
    token = 'zPMsqM9T6RBeIvWOrhPrj1DR6YxQW9TZvqGi8ZD/KDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034