UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D28oD4ouDi1O6stGG0o2byhyFFHg6m5OX2Tejsl8DSE=' 
WHERE 
  key_id = '0d60d569f9ef77ca3e27e923817305d8a74956899e29a27791be36ecdf185622' 
  AND (
    token = 'D28oD4ouDi1O6stGG0o2byhyFFHg6m5OX2Tejsl8DSE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037