UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NMd4mkjdTeCgm0W3L7QYbRovfoTxahGxDvcBibyz4cI=' 
WHERE 
  key_id = 'fe99b3dad8f44611a80b8a225dd13d07676decc3281fe218449e47d6c20cc7ff' 
  AND (
    token = 'NMd4mkjdTeCgm0W3L7QYbRovfoTxahGxDvcBibyz4cI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024