UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vFTn+7WYeXeoluuRWxtZC8WJRtmYKg7W6A3P3ERm7Zw=' 
WHERE 
  key_id = '21ed7ead46e6384a896efb3a2273eb23bee1cf68609d1c25a2c07d6c1a15160c' 
  AND (
    token = 'vFTn+7WYeXeoluuRWxtZC8WJRtmYKg7W6A3P3ERm7Zw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050