UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kFze8lRJGOpl+CdqIIn8E/1P1DCcm87Y/zj/Ul8Nb6w=' 
WHERE 
  key_id = 'd5e473ad17a08a3a17a56356dbf0319bc11222755907ee0af97746caacdfacd9' 
  AND (
    token = 'kFze8lRJGOpl+CdqIIn8E/1P1DCcm87Y/zj/Ul8Nb6w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033