UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TJ/k0NnxdCTYBrn0QMuOJIsq6jbM0qJpv78hKGIi/5Q=' 
WHERE 
  key_id = 'b0eb6ca845d019aa488f549b8a1a643872abc13e8f0e3f73e925010e4d3699e3' 
  AND (
    token = 'TJ/k0NnxdCTYBrn0QMuOJIsq6jbM0qJpv78hKGIi/5Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031