UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yccdAVEUNDpTfz/bwNBcgJkrQYW8wasltEk+/KsJqik=' 
WHERE 
  key_id = 'fbf0053d27a97468688a783495b772d56aa37d4addb057ffba95c6e38652c8d4' 
  AND (
    token = 'yccdAVEUNDpTfz/bwNBcgJkrQYW8wasltEk+/KsJqik=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017