UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '17kXe/F+kqEsegoBY3e3diB5XTX63NdR5qg1nCD8ITc=' 
WHERE 
  key_id = 'e72baf980b4d162f29b8340d54f996b7781d4e6e203ab7d201b0c88a692703d7' 
  AND (
    token = '17kXe/F+kqEsegoBY3e3diB5XTX63NdR5qg1nCD8ITc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021