UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X6cMr6G1d3QJySYZW6TY9GkmY2M3O/2McRZpd/6SLLQ=' 
WHERE 
  key_id = '6c34980b2daf4f2a15d6df38bcd5d208bb6b7b7a61662ab9cafcdd574034d1ff' 
  AND (
    token = 'X6cMr6G1d3QJySYZW6TY9GkmY2M3O/2McRZpd/6SLLQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022