UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AHDJrDNDNoVVGvKCNdphg7m9FbFLP7EZcF7aiSWW92w=' 
WHERE 
  key_id = '391829fb0f4f6439ce4b9b99775c2251d53764519733d3c01dde4e4d66d03184' 
  AND (
    token = 'AHDJrDNDNoVVGvKCNdphg7m9FbFLP7EZcF7aiSWW92w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033