UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Az/oQkuE/mASC7Tg9FxTzqJepC1zeWTaYjk5+o/FDA0=' 
WHERE 
  key_id = '8a1c7f315ab032ddafe148ac6a623168d08f89a441d7dd3a9697331aa7358c11' 
  AND (
    token = 'Az/oQkuE/mASC7Tg9FxTzqJepC1zeWTaYjk5+o/FDA0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029