UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HdqtHAGkLsuG6Cw3DOyH84qsdDk+4wku5oP+B/q3TGQ=' 
WHERE 
  key_id = '0949751757d9e78ab36154d042a38260ca101c1db6e4516f5ec06601c97644a2' 
  AND (
    token = 'HdqtHAGkLsuG6Cw3DOyH84qsdDk+4wku5oP+B/q3TGQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042