UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pbzzbyJWwdk2n2j8ZFsjQQPnwqyJWoMKjsv1h/wTJd8=' 
WHERE 
  key_id = 'cb3158a35538d7dc35221c788b94ea3dda8b5ddcb195ad00d3ca885998781673' 
  AND (
    token = 'pbzzbyJWwdk2n2j8ZFsjQQPnwqyJWoMKjsv1h/wTJd8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045