UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x+bopISK/qDyxK9KI+v9yxBxmYUqwtAo+Mw7puhmkVI=' 
WHERE 
  key_id = 'db8a480284609f7c46041b11ef45b1d4baf11d1b5f986701335347fa1d5e300f' 
  AND (
    token = 'x+bopISK/qDyxK9KI+v9yxBxmYUqwtAo+Mw7puhmkVI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038